<Project>

  <Import Project="..\Directory.Build.props" />

  <PropertyGroup>
    <TargetFramework>$(NetCoreAppCurrent)-$(TargetOS)</TargetFramework>
    <EnableDefaultItems>true</EnableDefaultItems>
    <!-- By default make shims compile against reference assemblies. -->
    <CompileUsingReferenceAssemblies>true</CompileUsingReferenceAssemblies>
    <!-- Ensure the .NET Framework shims reference the lowest possible version of dependencies since
         those do not all ship as part of the framework and we don't want to force apps to reference the
         latest packages. netstandard.dll doesn't need to do this since it has no dangling dependencies. -->
    <GenFacadesForceZeroVersionSeeds Condition="$(NetFxReference.Contains('$(MSBuildProjectName);'))">true</GenFacadesForceZeroVersionSeeds>
    <!-- Opt out of some features which are on by default. -->
    <EnableLibraryImportGenerator>false</EnableLibraryImportGenerator>
    <ApiCompatValidateAssemblies>false</ApiCompatValidateAssemblies>
    <ILLinkTrimAssembly>false</ILLinkTrimAssembly>
    <AddOSPlatformAttributes>false</AddOSPlatformAttributes>
    <GenerateDocumentationFile>false</GenerateDocumentationFile>
    <SkipLocalsInit>false</SkipLocalsInit>
    <!-- Allow shim ref projects to reference source projects which is required for referencing shared
        framework dependencies. -->
    <SkipValidateReferenceAssemblyProjectReferences Condition="'$(IsReferenceAssemblyProject)' == 'true'">true</SkipValidateReferenceAssemblyProjectReferences>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsSourceProject)' == 'true'">
    <ContractProject>$(MSBuildProjectDirectory)\..\ref\$(MSBuildProjectName).csproj</ContractProject>
    <IsRuntimeAndReferenceAssembly Condition="!Exists('$(ContractProject)')">true</IsRuntimeAndReferenceAssembly>
  </PropertyGroup>

  <ItemGroup Condition="'$(IsSourceProject)' == 'true'">
    <!-- If an extra reference source project exists, use its source. -->
    <Compile Include="$(MSBuildProjectDirectory)\..\ref\$(MSBuildProjectName).cs"
             Condition="'$(IsRuntimeAndReferenceAssembly)' != 'true'"  />
  </ItemGroup>

  <ItemGroup Condition="'$(GenFacadesForceZeroVersionSeeds)' == 'true'">
    <PackageReference Include="Microsoft.DotNet.GenFacades"
                      Version="$(MicrosoftDotNetGenFacadesVersion)"
                      PrivateAssets="all"
                      IsImplicitlyDefined="true" />
  </ItemGroup>

</Project>
